package com.ctbri.arrays;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

class BerylliumSphere {
	private static long counter;
	public final long id = counter++;
	@Override
	public String toString() {
		return "Sphere " + id;
	}
}
public class ContainerComparison {
	public static void main(String[] args) {
		BerylliumSphere[] sphereArray = new BerylliumSphere[10];
		for(int i = 0; i < 10; i++)
			sphereArray[i] = new BerylliumSphere();
		
		List<BerylliumSphere> sphereList = new ArrayList<>();
		for(int i = 0; i < 10; i++)
			sphereList.add(new BerylliumSphere());
		
		System.out.println(Arrays.toString(sphereArray));
		System.out.println(sphereArray[4]);
	
		System.out.println(sphereList);
		System.out.println(sphereList.get(4));
		
		int[] intArray = { 0, 1, 2, 3, 4, 5};
		
		List<Integer> intList = Arrays.asList(0, 1, 2, 3, 4, 5);
		
		System.out.println(Arrays.toString(intArray));
		System.out.println(intArray[4]);
		
		System.out.println(intList);
		System.out.println(intList.get(4));
	}
}
